/*
 *	dfclient_set.c
 *	© 2009 DigiFi Limited
 *
 *	Contains functions that set values on the digifi
 *
 */

#include "../headers/dfset.h"


int dfset_volume(unsigned int room_id, int val) {
	if (val>=0 && val<=255) {
		return df_queuecommand(DF_VOID_COMMAND, "void", NULL, "[SetVolume %d %d]", room_id, val);
	}
	else {
		return -1;
	}
}


int dfset_repeat(unsigned int room_id, int val) {
	if (val>=0 && val<=1) {
		return df_queuecommand(DF_VOID_COMMAND, "void", NULL, "[SetRepeat %d %d]", room_id, val);
	}
	else {
		return -1;
	}
}


int dfset_shuffle(unsigned int room_id, int val) {
	if (val>=0 && val<=1) {
		return df_queuecommand(DF_VOID_COMMAND, "void", NULL, "[SetShuffle %d %d]", room_id, val);
	}
	else {
		return -1;
	}
}

int dfset_track(unsigned int room_id, int val) {
	if (val>=0) {
		return df_queuecommand(DF_VOID_COMMAND, "void", NULL, "[SetTrack %d %d]", room_id, val);
	}
	else {
		return -1;
	}
}
